/*
 * Copyright (c) 2010, VeRSI Consortium
 *   (Victorian eResearch Strategic Initiative, Australia)
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of the VeRSI, the VeRSI Consortium members, nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package versi.vitro.oaiserviceprovider.helper;

import static versi.vitro.oaiserviceprovider.helper.PropertyFileReader.*;

/**
 * Service related constants.
 */
public class Constant {

    /** xslt stylesheet used to transform RDF to OAICAT-friendly RIFCS record. */
    public static final String XSLT_LOCATION = loadProperty(Key.XSLT_LOCATION);

    /**
     * andstriples (the set of triples to be harvested by ANDS -without
     * harvestdates)
     * */
    public static final String ANDS_TRIPLES_MODEL_NAME = loadProperty(Key.ANDSTRIPLES_MODELNAME);

    /**
     * additional Information triples used as the extra source of the andstriples.
     * */
    public static final String ADD_INFO_MODEL_NAME = loadProperty(Key.ADDINFO_MODELNAME);
    
    /**
     * model used to stored the created handle values.
     * */
    public static final String HANDLE_MODEL_NAME = loadProperty(Key.HANDLE_MODELNAME);
    
    /**
     * andHarvestOut (the set of triples to be harvested by ANDS with
     * harvestedBy dates)
     * */
    public static final String AND_HARVEST_OUT_MODEL_NAME = loadProperty(Key.ANDSHARVESTOUT_MODELNAME);

    /**
     * newsANDSTriples(the model representing the new statements since last
     * harvest)
     * */
    public static final String NEW_ANDS_TRIPLES_MODEL_NAME = loadProperty(Key.NEWANDSTRIPLES_MODELNAME);

    /**
     * timestampTriples (the model storing the harvesting timestamp about andtriples)
     * */
    public static final String TIMESTAMP_MODEL_NAME = loadProperty(Key.TIMESTAMP_MODELNAME);

    /**
     * Locations of all the schema used in validation process.
     * */
    public static final String[] schemasLocations = loadProperty(Key.SCHEMAS_LOCATION).split(";");

    /** VITRO/VIVO default model. */
    public static final String VITRO_JENA_DEFAULT_MODEL = loadProperty(Key.VITRO_JENA_DEFAULT_MODEL);

    /** VITRO/VIVO default internal model. */
    public static final String VITRO_JENA_DEFAULT_INTERNAL_MODEL = loadProperty(Key.VITRO_JENA_DEFAULT_INTERNAL_MODEL);

    /** VITRO/VIVO default audit model. */
    public static final String VITRO_JENA_DEFAULT_AUDIT_MODEL = loadProperty(Key.VITRO_JENA_DEFAULT_AUDIT_MODEL);

    /** Date Time format used by OAI-PMH records. */
    public static final String DATETIME_FORMAT = loadProperty(Key.DATETIME_FORMAT);

   
    /**
     * Load an application property value.
     * 
     * @param key
     *            Property key.
     * @return String Property value.
     */
    protected static String loadProperty(String key) {
	return getInstance().getValue(key);
    }
}
